package kgc.qy.mapper;

import kgc.qy.pojo.SysUsers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUsersMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUsers record);

    int insertSelective(SysUsers record);

    SysUsers selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUsers record);

    int updateByPrimaryKey(SysUsers record);

    SysUsers selectByUserAccountAndPwd(@Param("account") String account,
                                       @Param("pwd") String pwd);

    /**
     * 通过用户的 类型，账号，用户名查询用户列表
     * 动态sql 模糊查询
     * @param account
     * @param userName
     * @param userType
     * @return
     */
    List<SysUsers> selectSysUserByPram(@Param("account") String account,
                                       @Param("userName") String userName,
                                       @Param("userType") Byte userType);

    /**
     * 通过id status 更改用户账号的状态
     * @param id
     * @param status
     * @return int
     */
    int updateUserStatusById(@Param("id") int id,
                             @Param("status") int status);
}